// vue.config.js

const path = require('path');
function resolve (dir) {
    return path.join(__dirname, dir)
}

module.exports = {
    devServer: {
        proxy: {
          // change xxx-api/login => mock/login
          // detail: https://cli.vuejs.org/config/#devserver-proxy
          '/api': {
            target: 'http://localhost:8080',
            pathRewrite: {
              '^/api':'/mock'
            }
          }
        }
    },
    // 选项...
    chainWebpack: config => {
        config.resolve.alias
            .set('styles', resolve('src/assets/styles'))
    }
  }
  